package com.azzaou.model;

import java.io.Serializable;

public class User  implements Serializable {

	private static final long serialVersionUID = 1L;
	private Long id;
	private String nom;
	private String prenom;
	private String login;
	private String password;
	private String passwordText;
	private String statut;
	private String statutValue;
	private String type;
	private String role;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public String getPrenom() {
		return prenom;
	}

	public void setPrenom(String prenom) {
		this.prenom = prenom;
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getStatut() {
		return statut;
	}

	public void setStatut(String statut) {
		this.statut = statut;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getRole() {
		if(type!=null)
		{
			if("A".equalsIgnoreCase(type))
			{
				role = "Administrateur";
			}
			else if("S".equalsIgnoreCase(type))
			{
				role = "Simple Utilisateur";
			}
		}
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}


	public String getStatutValue() {
		if(statut!=null)
		{
			if("A".equalsIgnoreCase(statut))
			{
				statutValue = "Actif";
			}
			else if("I".equalsIgnoreCase(statut))
			{
				statutValue = "Inactif";
			}
		}
		return statutValue;
	}

	public void setStatutValue(String statutValue) {
		this.statutValue = statutValue;
	}

	public String getPasswordText() {
		return passwordText;
	}

	public void setPasswordText(String passwordText) {
		this.passwordText = passwordText;
	}
	
}